<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>结构伪类测试</title>
	<style type="text/css">
		.item:first-child {
			border-top: 1px solid red;
		}
		.item:last-child {
			border-bottom: 2px solid gray;
		}
		.item:nth-child(even) {
			color: red;
		}
		.item:nth-child(2n+1) {
			color: blue;
		}
		.item:nth-child(4) {
			background: #f5f5f5;
		}
		.item:nth-last-child(5) {
			background: #ccc;
		}
	</style>
</head>
<body>
	<ul class="list">
		<li class="item">HTML</li>
		<li class="item">CSS</li>
		<li class="item">Javascript</li>
		<li class="item">Sass</li>
		<li class="item">Less</li>
		<li class="item">Node.js</li>
	</ul>
	<p>“:nth-child(n)”，n可以是数字（4）、关键词（odd,even）或公式（2n+1）</p>
</body>
</html>

